﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Data;
using System.ComponentModel;


namespace baseClass.Controls
{
    public class gridStatement : common.controls.baseDataGridView 
    {
        public enum ColumnNames
        {
            statementNo, onDate, notes
        };

        public gridStatement()
        {
        }

        public override void LockEdit(bool lockStat)
        {
            base.LockEdit(true); 
        }
        public override void Init()
        {
            base.Init();
            data.baseDS.geStatementDataTable dummyTbl = new data.baseDS.geStatementDataTable();

            // =============================
            // detailGrid
            // =============================

            // statementNo
            common.controls.DataGridViewTextBoxColumnExt statementNo = new common.controls.DataGridViewTextBoxColumnExt();
            statementNo.Uppercase = true;
            statementNo.DataPropertyName = dummyTbl.statementNoColumn.ColumnName;
            statementNo.HeaderText = "Số";
            statementNo.Name = ColumnNames.statementNo.ToString();
            statementNo.Width = 130;

            // notes
            common.controls.DataGridViewTextBoxColumnExt notes = new common.controls.DataGridViewTextBoxColumnExt();
            notes.DataPropertyName = dummyTbl.desc1Column.ColumnName;
            notes.HeaderText = "Diễn giải";
            notes.Name = ColumnNames.notes.ToString();
            notes.Width = 130;

            // onDate
            common.controls.DataGridViewTextBoxColumnExt onDate = new common.controls.DataGridViewTextBoxColumnExt();
            onDate.DataPropertyName = dummyTbl.onDateColumn.ColumnName;
            onDate.HeaderText = "Ngày";
            onDate.Name = ColumnNames.onDate.ToString();
            onDate.DefaultCellStyle = application.SysLibs.CellTypeDATE();
            onDate.Width = 85;



            this.Columns.Clear();
            this.Columns.AddRange(new DataGridViewColumn[] { statementNo,onDate,notes});

            this.myAutoFitColumn = ColumnNames.notes.ToString();
            this.AutoFit();
        }

    }
}
